/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import Dao.AlunoDao;
import Dao.AlunoDaoImplJPA;
import Dao.HistoricoTurmaDao;
import Dao.HistoricoTurmaDaoImplJPA;
import Dao.TurmaDao;
import Dao.TurmaDaoImplJPA;
import Pojo.Aluno;
import Pojo.HistoricoTurma;
import Pojo.Turma;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author thiago
 */
public class FormMatriculaAlunos extends javax.swing.JInternalFrame {

    /** Turma atual*/
    private Turma turmaAtual;

    /**
     * Getter da Turma Atual
     * @return 
     */
    public Turma getTurmaAtual() {
        return turmaAtual;
    }

    /**
     * Setter da Turma atual
     * @param turmaAtual 
     */
    public void setTurmaAtual(Turma turmaAtual) {
        this.turmaAtual = turmaAtual;
    }
    
    /**
     * Creates new form FormMatriculaAlunos
     */
    public FormMatriculaAlunos() {
        initComponents();
        this.buscarTurmasAbertas();
    }
    
    private void buscarTurmasAbertas(){
        TurmaDao turmaDao = new TurmaDaoImplJPA();
        List<Turma> listaTurmas = turmaDao.pesquisarTurmasAbertas();
        
        if (listaTurmas.isEmpty()){
            JOptionPane.showMessageDialog(null, "Não há nenhuma turma aberta no momento.\nCadastre uma para poder matricular alunos.");
        }
        
        for(Turma turma : listaTurmas){
            cbbTurmas.addItem(turma.getId()+" - "+turma.getDisciplina().getNome()+" - "+turma.getAno()+" - "+turma.getPeriodo());
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        cbbTurmas = new javax.swing.JComboBox();
        btnCarregarDados = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblAlunosMatriculados = new javax.swing.JTable();
        jLabel2 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        txtCodigo = new javax.swing.JTextField();
        txtDisciplina = new javax.swing.JTextField();
        txtAno = new javax.swing.JTextField();
        txtPeriodo = new javax.swing.JTextField();
        txtLocalizacao = new javax.swing.JTextField();
        txtTotalVagas = new javax.swing.JTextField();
        txtVagasRestantes = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblAlunosRestantes = new javax.swing.JTable();
        btnInserirAlunos = new javax.swing.JButton();

        setClosable(true);
        setTitle("Matrícula de Alunos");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Turma"));

        btnCarregarDados.setText("Carregar Dados");
        btnCarregarDados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCarregarDadosActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel9.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
        jLabel9.setText("Código");

        jLabel10.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
        jLabel10.setText("Disciplina");

        jLabel11.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
        jLabel11.setText("Ano");

        jLabel12.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
        jLabel12.setText("Período");

        jLabel13.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
        jLabel13.setText("Localização");

        jLabel14.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
        jLabel14.setText("Total Vagas");

        jLabel15.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
        jLabel15.setText("Vagas Restantes");

        tblAlunosMatriculados.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Aluno"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tblAlunosMatriculados);

        jLabel2.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
        jLabel2.setText("Alunos Matriculados");

        txtCodigo.setEnabled(false);

        txtDisciplina.setEnabled(false);

        txtAno.setEnabled(false);

        txtPeriodo.setEnabled(false);

        txtLocalizacao.setEnabled(false);

        txtTotalVagas.setEnabled(false);

        txtVagasRestantes.setEnabled(false);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel12)
                                    .addComponent(jLabel11)
                                    .addComponent(jLabel10)
                                    .addComponent(jLabel9))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtPeriodo, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtAno, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel15)
                                    .addComponent(jLabel14)
                                    .addComponent(jLabel13))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtLocalizacao, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtTotalVagas, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtVagasRestantes, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(8, 8, 8))
                            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addContainerGap())))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
                    .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(txtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtLocalizacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jLabel14)
                    .addComponent(txtDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTotalVagas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
                    .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(txtAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtVagasRestantes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(txtPeriodo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
                .addContainerGap())
        );

        tblAlunosRestantes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Aluno", "Inserir"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Boolean.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane2.setViewportView(tblAlunosRestantes);

        btnInserirAlunos.setText("Inserir Alunos");
        btnInserirAlunos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInserirAlunosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(cbbTurmas, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnCarregarDados))
                    .addComponent(jScrollPane2)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(btnInserirAlunos)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(btnCarregarDados)
                    .addComponent(cbbTurmas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnInserirAlunos))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void carregarDadosAlunos(){
        //preenchendo os campos
        txtCodigo.setText(String.valueOf(this.getTurmaAtual().getId()));
        txtDisciplina.setText(this.getTurmaAtual().getDisciplina().getNome());
        txtAno.setText(String.valueOf(this.getTurmaAtual().getAno()));
        txtPeriodo.setText(String.valueOf(this.getTurmaAtual().getPeriodo()));
        txtLocalizacao.setText(this.getTurmaAtual().getLocalizacao());
        txtTotalVagas.setText(String.valueOf(this.getTurmaAtual().getNumeroDeVagas()));
        
        
        //Buscando o histórico da turma
        HistoricoTurmaDao historicoTurmaDao = new HistoricoTurmaDaoImplJPA();
        List<HistoricoTurma> listaHistoricosTurma = historicoTurmaDao.pesquisarPorTurma(this.getTurmaAtual());

        //preenchendo a tabela de alunos matriculados
        DefaultTableModel model = (DefaultTableModel) tblAlunosMatriculados.getModel();
        Object[] linha = new Object[2];
        model.setRowCount(0);
        for (HistoricoTurma h: listaHistoricosTurma){
            linha[0] = String.valueOf(h.getAluno().getId());
            linha[1] = h.getAluno().getNome();
            model.addRow(linha);
        }
        tblAlunosMatriculados.repaint();

        //Calculo do número de vagas restantes.
        txtVagasRestantes.setText(String.valueOf(this.getTurmaAtual().getNumeroDeVagas()-listaHistoricosTurma.size()));

        //Buscando a lista de todos os alunos
        AlunoDao alunoDao = new AlunoDaoImplJPA();
        List<Aluno> listaAlunos = alunoDao.pesquisarTodos();
        model = (DefaultTableModel) tblAlunosRestantes.getModel();
        linha = new Object[2];
        model.setRowCount(0);
        int verificador=0;
        for (Object o: listaAlunos){
            Aluno a = (Aluno) o;
            verificador=0;
            for (HistoricoTurma h: listaHistoricosTurma){
                if (h.getAluno().getId()==a.getId()){
                    verificador=1;
                    break;
                }
            }
            if (verificador==0){
                linha[0] = String.valueOf(a.getId());
                linha[1] = a.getNome();
                model.addRow(linha);   
            }
        }
        tblAlunosMatriculados.repaint();
    }
    
    private void btnCarregarDadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCarregarDadosActionPerformed
        String turmaString = (String) cbbTurmas.getSelectedItem();
        if (turmaString != null){
            //carregando dados
            String[] dados = turmaString.split(" - ");
            TurmaDao turmaDao = new TurmaDaoImplJPA();
            this.setTurmaAtual(turmaDao.pesquisarPorId(Integer.parseInt(dados[0])));
                      
            this.carregarDadosAlunos();
        }
    }//GEN-LAST:event_btnCarregarDadosActionPerformed

    private void btnInserirAlunosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInserirAlunosActionPerformed
        //Verificando a existência de uma turma
        if (this.getTurmaAtual()==null){
            JOptionPane.showMessageDialog(null, "Escolha a turma para poder matricular os alunos.");
            return;
        }
        
        //Declarando e inicializando variáveis        
        int linha;
        boolean inserir;
        AlunoDao alunoDao = new AlunoDaoImplJPA();
        HistoricoTurmaDao historicoTurmaDao = new HistoricoTurmaDaoImplJPA();
        Aluno aluno;
        HistoricoTurma historicoTurma;
        int quantidadeRestante = Integer.parseInt(txtVagasRestantes.getText());
        
        //Calculando a quantidade de alunos marcados
        linha=0;
        while(linha<tblAlunosRestantes.getRowCount()){
            if (tblAlunosRestantes.getValueAt(linha, 2)==null){
                inserir = false;
            }else{
                inserir = (Boolean) tblAlunosRestantes.getValueAt(linha, 2);
            }
            if (inserir==true){
                quantidadeRestante--;
            }
            linha++;
        }
        
        //Verificando se a quantidade de vagas restantes é suficiente para abranger todos os alunos
        if (quantidadeRestante<0){
            JOptionPane.showMessageDialog(null, "Quantidade de vagas disponível é menor que a quantidade de alunos que se quer matricular.");
            return;
        }

        //Realizando a matricula e mostrando a tabela
        linha=0;
        while(linha<tblAlunosRestantes.getRowCount()){
            if (tblAlunosRestantes.getValueAt(linha, 2)==null){
                inserir = false;
            }else{
                inserir = (Boolean) tblAlunosRestantes.getValueAt(linha, 2);
            }
            if (inserir==true){
                aluno = alunoDao.pesquisarPorId(Integer.parseInt((String)tblAlunosRestantes.getValueAt(linha, 0)));
                historicoTurma = new HistoricoTurma(0, 0.0, false, aluno, this.getTurmaAtual());
                historicoTurmaDao.inserir(historicoTurma);
            }
            linha++;
        }
        this.carregarDadosAlunos();
    }//GEN-LAST:event_btnInserirAlunosActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCarregarDados;
    private javax.swing.JButton btnInserirAlunos;
    private javax.swing.JComboBox cbbTurmas;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTable tblAlunosMatriculados;
    private javax.swing.JTable tblAlunosRestantes;
    private javax.swing.JTextField txtAno;
    private javax.swing.JTextField txtCodigo;
    private javax.swing.JTextField txtDisciplina;
    private javax.swing.JTextField txtLocalizacao;
    private javax.swing.JTextField txtPeriodo;
    private javax.swing.JTextField txtTotalVagas;
    private javax.swing.JTextField txtVagasRestantes;
    // End of variables declaration//GEN-END:variables
}
